package com.highper.gateway.service;

import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @Author ZhangGJ
 * @Date 2022/02/10 17:34
 */
public interface IDynamicRouteService {

    /**
     * 查询所有路由
     *
     * @return
     */
    Flux<RouteDefinition> list();

    /**
     * 新增路由
     *
     * @param definition
     * @return
     */
    int insert(RouteDefinition definition);

    /**
     * 修改路由
     *
     * @param definition
     * @return
     */
    int update(RouteDefinition definition);

    /**
     * 删除路由
     *
     * @param id
     * @return
     */
    Mono<ResponseEntity<Object>> delete(String id);

}
